package top.purity.server.tenant.domain;

import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.Index;
import jakarta.persistence.Table;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.annotations.Comment;
import top.purity.framework.orm.BaseDO;

/**
 * @version 1.0
 * @Author Lmh
 * @Description
 * @CreateTime 2023-09-24 15:15
 */

@Data
@EqualsAndHashCode(callSuper = true)
@Entity
@Table(name = "tenant_menu", indexes = {
        @Index(name = "idx_mc", columnList = "menu_code", unique = true),
        @Index(name = "idx_mn", columnList = "menu_name"),
        @Index(name = "idx_mu", columnList = "menu_uri")
})
public class TenantMenu extends BaseDO {
    @Column(name = "pid", nullable = false)
    @Comment("父id")
    private Long pid;

    @Column(name = "menu_name", nullable = false, length = 50)
    @Comment("菜单名称")
    private String menuName;

    @Column(name = "menu_code", nullable = false, unique = true, length = 100)
    @Comment("菜单编码")
    private String menuCode;

    @Column(name = "menu_type", nullable = false, length = 50)
    @Comment("菜单类型 0 目录 1 菜单 2 按钮")
    private String menuType;

    @Column(name = "menu_path", nullable = false, length = 100)
    @Comment("菜单前端路径")
    private String menuPath;

    @Column(name = "menu_uri", nullable = false, length = 100)
    @Comment("菜单后端地址")
    private String menuUri;

}
